A technology to measure a distance to a measured object by using a plurality of images having different viewpoints is known. For example, Patent Document 1 below discloses a distance calculation method using a technique called stereo matching.
In such a stereo matching technique, in the case where a distance is calculated from a plurality of parallax images along a horizontal direction (H direction) or a vertical direction (V direction) in the images, a phase difference between the parallax images is obtained. In processing of obtaining a phase difference, a local area (unit area) of a comparison target is sequentially moved in a horizontal direction, and a displacement (pixel displacement, disparity) between the parallax images in the unit areas, which have the highest correlation in a comparison range, is obtained as a phase difference. A distance can also be calculated from a plurality of parallax images along an arbitrary angle direction in the images.
Patent Document 1: Japanese Patent Application Laid-open No. 2011-171858